From e00eb06f66aaa41b9ba40db8bb6ef07570629dc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Florian=20M=C3=BCllner?= Date: Thu, 29 Nov 2012 17:58:31 +0100 Subject: [PATCH] overview: Handle sessionMode.hasOverview changes Currently we assume that either the initial sessionMode will have the overview or none of the pushed modes - starting without the overview and pushing a mode that adds it fails spectacularly. However this is exactly what we are going to do when loading external modes asynchronously - we'll initially use the default mode while the modes are loading, and switch to the mode passed on the command line when finished. So make sure that the overview UI gets initialized properly in that case. https://bugzilla.gnome.org/show_bug.cgi?id=689304 --- js/ui/overview.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/ui/overview.js b/js/ui/overview.js index 3f1663f33..3c1f03058 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -117,6 +117,7 @@ const Overview = new Lang.Class({ _init: function() { this._overviewCreated = false; + this._initCalled = false; Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated)); this._sessionUpdated(); @@ -204,6 +205,9 @@ const Overview = new Lang.Class({ this._lastActiveWorkspaceIndex = -1; this._lastHoveredWindow = null; this._needsFakePointerEvent = false; + + if (this._initCalled) + this.init(); }, _sessionUpdated: function() { @@ -216,6 +220,8 @@ const Overview = new Lang.Class({ // signal handlers and so forth. So we create them after // construction in this init() method. init: function() { + this._initCalled = true; + if (this.isDummy) return; -- 2.39.5